package com.sky.service.user.impl;

import com.sky.constant.RedisConstant;
import com.sky.mapper.user.UserSetmealMapper;
import com.sky.pojo.Setmeal;
import com.sky.service.user.UserSetmealService;
import com.sky.vo.DishItemVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class UserSetmealServiceImpl implements UserSetmealService {
    @Autowired
    private UserSetmealMapper userSetmealMapper;


    @Override
    @Cacheable(value = RedisConstant.SETMEAL,key = "#categoryId")
    public List<Setmeal> queryList(Long categoryId) {
        return userSetmealMapper.queryList(categoryId);
    }

    @Override
    @Cacheable(value = RedisConstant.SETMEAL,key = "#setmealId")
    public List<DishItemVO> findById(Integer setmealId) {
        return userSetmealMapper.findById(setmealId);
    }
}
